import {defineConfig} from 'vite'
import path from 'node:path'
import electron from 'vite-plugin-electron/simple'
import react from '@vitejs/plugin-react'
import UnoCss from 'unocss/vite'

export default defineConfig((params)=>{
    console.log(3333333333,params)
    return {
        plugins: [
            react(),
            UnoCss(),
            electron({
                main: {
                    entry: 'electron/main.ts',
                },
                preload: {
                    input: path.join(__dirname, 'electron/preload.ts'),
                },
                renderer: process.env.NODE_ENV === 'test'
                    ? undefined
                    : {},
            }),
        ],
        resolve:{
            alias: {
                "@": path.resolve(__dirname, "src"),
                "@assets": path.resolve(__dirname, "src/assets"),
                "@components": path.resolve(__dirname, "src/components"),
                "@pages": path.resolve(__dirname, "src/pages"),
                "@router": path.resolve(__dirname, "src/router"),
                "@type": path.resolve(__dirname, "src/type"),
            },
        },
    }
})
